import http from "@/common/http/request";
import { 
  musicSongChordsListInterface,
  musicSongChordsAddInterface,
  musicSongChordsUpdateInterface,
} from "./songChords.interface";
// 和弦列表(全部)
export const $musicSongChords = () => {
  const $http = new http();
  return $http.get({
    url: '/music/songChords/listTree',
  })
}

// 和弦列表(分页)
export const $musicSongChordsList = (data: musicSongChordsListInterface) => {
  const $http = new http();
  return $http.get({
    url: '/music/songChords/list',
    data,
  })
}

// 和弦详情
export const $musicSongChordsDetail = (id: string) => {
  const $http = new http();
  return $http.get({
    url: `/music/songChords/${id}`,
  })
}

// 新增和弦
export const $musicSongChordsAdd = (data: musicSongChordsAddInterface) => {
  const $http = new http();
  return $http.post({
    url: '/music/songChords',
    data,
  })
}

// 修改和弦
export const $musicSongChordsUpdate = (data: musicSongChordsUpdateInterface) => {
  const $http = new http();
  return $http.put({
    url: '/music/songChords',
    data,
  })
}

// 删除和弦
export const $musicSongChordsDelete = (data: Array<string>) => {
  const $http = new http();
  return $http.delete({
    url: `/music/songChords/${data.join(',')}`,
  })
}